/**
 * \* Created with IntelliJ IDEA.
 * \* User: 冯若航
 * \* Date: 2021/5/7
 * \* Time: 19:00
 * \* To change this template use File | Settings | File Templates.
 * \* Description:
 * \
 */
public class 不用加减乘除做加法 {
    public int add(int a, int b) {
        // 当进位为 0 时跳出
        while(b != 0) {
            // c = 进位
            int c = (a & b) << 1;
            // a = 非进位和
            a ^= b;
            // b = 进位
            b = c;
        }
        return a;
    }
}